package com.bw.controller;

import com.bw.bean.Gm;
import com.bw.service.GmService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GmController {
    @Autowired
    GmService gmService;
    @RequestMapping("list1")
    public List<Gm> a(){
       return gmService.getlist();
    }

    @RequestMapping("list2")
    public List<Gm> b(){
        PageHelper.startPage(1,2);
        return gmService.getlimit();
    }

    @RequestMapping("list3")
    public List<Gm> c(String name){
        return gmService.getName(name);
    }

    @RequestMapping("list4")
    public List<Gm> d(){
        return gmService.getsx();
    }

    @RequestMapping("list5")
    public List<Gm> e(){
        return gmService.jx();
    }
}
